package com.chixing.controller;

import com.chixing.service.ItineraryPlanService;
import com.chixing.util.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class ItineraryPlanController {
    @Autowired
    private ItineraryPlanService itineraryPlanService;

    @GetMapping("bespoke/{id}")
    public ModelAndView getItineraryTosalesById(@PathVariable("id")Integer id){
        ServerResponse response = itineraryPlanService.getItineraryTosalesById(id);
        ModelAndView mav = new ModelAndView();
        mav.addObject("response",response);
        mav.setViewName("bespoke/bespoke");
        return mav;
    }
}
